/*
 * Created on 2004-02-26
 */
package org.opencube.oms.test;

/**
 * @author <a href="mailto:maciek@fingo.pl">FINGO - Maciej Mroczko</a>
 * TODO: comment
 */
public class TableState
{
	/* The table name */
	private String tableName = null;
	/* The table hash */
	private int hashCode = 0;
	
	/**
	 * @param tableName
	 * @param tableHash
	 */
	public TableState( String tableName, int tableHash )
	{
		this.tableName = tableName;
		this.hashCode = tableHash;
	}
	
	/**
	 * @return
	 */
	public String getTableName()
	{
		return tableName;
	}
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals( Object o )
	{
		if( o instanceof TableState )
		{
			return ( ( (TableState) o ).getTableName().equals( tableName ) && o.hashCode() ==  hashCode );
		}
		return false;
	}	
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode()
	{
		return hashCode;
	}
}
